﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
enum EquipmentType {Shirt,Chest,Plate,Shoulders,Hands,Bracers,Cape,Belt,Legs,Feet,MainHand,Offhand,Twohand,Ring,Neck,Trincket,HeadCovering,Head}
[CreateAssetMenu(fileName = "Equipment", menuName = "Items/Equipment/Equip", order = 3)]
public class Equipment : Item
{
    [SerializeField]
    private int strength;
    [SerializeField]
    private int dexterity;
    [SerializeField]
    private int vitality;
    [SerializeField]
    private int intelligence;
    [SerializeField]
    private int wisdom;
    [SerializeField]
    private int armour;
    [SerializeField]
    private EquipmentType type;
    [SerializeField]
    private AnimationClip[] animations;

    public AnimationClip[] MyAnimations { get => animations;  }
    internal EquipmentType MyType { get => type; }
    

    public override string Description()
    {
        string stats = string.Empty;
        if (strength != 0)
        {
            stats += string.Format("\n{0} STR", strength);
        }
        if (dexterity != 0)
        {
            stats += string.Format("\n{0} DEX", dexterity);
        }
        if (vitality != 0)
        {
            stats += string.Format("\n{0} VIT", vitality);
        }
        if (intelligence != 0)
        {
            stats += string.Format("\n{0} INT", intelligence);
        }
        if (wisdom != 0)
        {
            stats += string.Format("\n{0} WIS", wisdom);
        }
        if (armour != 0)
        {
            stats += string.Format("\n{0} ARM", armour);
        }
        return base.Description()+stats;
    }
    public void Equip()
    {
        CharcterPanel.MyInstance.EquipArmor(this);
    }
}
